﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebAPI.Service1.DAL;
using WebAPI.Service1.Model;

namespace WebAPI.Service1.BLL
{
    public class TestBLL
    {
        public string Test(RequestEntity guid)
        {
            string errMsg = "";
            TestDAL _dal = new TestDAL();
            try
            {
                switch (guid.Type)
                {
                    case "1":
                        errMsg = _dal.Insert(guid);
                        return errMsg;
                    case "2":
                        errMsg = _dal.Delete(guid);
                        return errMsg;
                    case "3":
                        errMsg = _dal.Select(guid);
                        return errMsg;
                    case "4":
                        errMsg = _dal.SelectAll(guid);
                        return errMsg;
                    case "5":
                        errMsg = _dal.Update(guid);
                        return errMsg;
                }
            }
            catch (Exception ex)
            {
                errMsg += ex.Message;
            }
           
            return errMsg;
        }
    }
}